package com.xiaoxi.singletonmode;

import com.xiaoxi.singletonmode.singleton.Ticket;

/**
 * @ClassName Main
 * @Description
 * @Author xiaoxi
 * @Date 2023/3/12 14:38
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        Ticket ticket1 = Ticket.getInstance(0);
        Ticket ticket2 = Ticket.getInstance(1);
        Ticket ticket3 = Ticket.getInstance(2);
        if (ticket1 == ticket2) {
            System.out.println("两者一样");
        } else {
            System.out.println("两者不一样");
        }

        ticket1.cellTicket();
        ticket2.cellTicket();
        ticket3.cellTicket();
    }
}
